package stud.mpgame.physics;

/**
 * ...
 * @author pavel[f.pavel91@gmail.com]
 */
public class Circle implements IBody {

	public float x;
	public float y;
	public float radius;
	public Vector2D velocity;
	
	public Circle(float x, float y, float radius, Vector2D velocity) {
		this.x = x;
		this.y = y;
		this.radius = radius;
		this.velocity = velocity;
	}
	
	public void intersect(Circle circle) {
		float dx = x - circle.x;
		float dy = y - circle.y;
		float distance = (float) Math.sqrt(dx * dx + dy * dy);
		if (distance  - radius - circle.radius > 0)
			return;
		//TODO
		return;
	}
	
	public int getCellX() {
		return (int) x / 64;
	}
	
	public int getCellY() {
		return (int) y / 64;
	}
	
	public void move(Vector2D vector2D) {
		x += vector2D.x;
		y += vector2D.y;
	}
	
}